#ifndef JDATALOGGING_H
#define JDATALOGGING_H
#include "misc/Cgdi.h"
#include "jFileIO.h"
#include <sstream>
//-----------------------------------------------------------------------------
//
//  Name:   jDataLogging.h
//
//  Class for displaying Testing data onscreen and saving data to a logging
//	file on the Hard Drive.
//  
//-----------------------------------------------------------------------------
using namespace std;

class jDataLogging
{
  
public:

  static jDataLogging& Instance()
  {
//    if (!m_pInstance)
	static jDataLogging m_pInstance;

    return m_pInstance;
  }

//	jDataLogging(string fileName, string algType);
	//+ getInstance: jLogging
	void setInfo(string fileName, string algType);
	void setMapName(string mapName);
	bool clearData();
	bool outPutToFile();
	void RenderGui();
	void UpdateGui();

	void addPathSearchTime(int ticks);

	void addRecalculation();
	void addCollision();
	void setAgentAmount(int amount);
	void addAgentAmount();
	int getAgentCount();
	float AverageCollisionsPerMin();
	float AverageRecalculationsPerMin();
	float AverageSearchTime();
	void recieveCalculationTime(float time);

	void setElapsedTime(float time);
	
	float getTime()
	{
		return m_ElapsedTime;
	}
	void setFPS(float fps);


	// Other non-static member functions
//private:
  jDataLogging();
  jDataLogging(const jDataLogging&){};                 // Prevent copy-construction
  jDataLogging& operator=(const jDataLogging&){};      // Prevent assignment
  ~jDataLogging();

protected:
	jFileIO fileIO;
	//static jDataLogging m_pInstance;

	//STD for containing ongoing values
	std::vector<int> m_ReCalculationsTimeCont;

	//Values as int
	int m_BotNumber;
	int m_Collisions;
	int m_PathSearchTimes;
	int m_ReCalculations;
	float m_ElapsedTime;
	float m_FramesPerSecound;

	//Values as a string for writing to file.
	string m_ElapsedTimeString;
	string m_FileName;
	string m_AlgorithmType;
	string m_LevelName;
	string m_FramesPerSecoundString;

	string m_CollisionsString;
	string m_BotNumberString;
	string m_ReCalculationsString;
	string m_PathSearchTimesString;



};

#endif
